<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8" />
	<title>直播</title>
	<link rel="stylesheet" href="bootstrap/css/bootstrap.min.css">
	<link rel="stylesheet" type="text/css" href="css/TV.css" />
	<link rel="stylesheet" href="css/upWindow.css" />
	<link rel="stylesheet" type="text/css" href="css/style.css" />
	<link rel="stylesheet" href="css/base.css" />
	<script src="bootstrap/js/jquery1.11.3.js"></script>
	<script src="bootstrap/js/bootstrap.min.js"></script>
	<!--<script type="text/javascript" src="js/register.js"></script>-->
	<script type="text/javascript" src="js/topPublic.js"></script>
</head>
<body>
	<script type="text/javascript" src="js/header.js"></script>
	<div class="container-fluid">
        <div class="row-fluid">
            <div class="span12">
                <img src="img/tv1.jpg" style="width: 100%;margin-bottom:30px;min-width:1178px;"/>
            </div>
        </div>
		<div class="Mom-photo" id="video">
			<div class="Mbox">
				<div class="Mphoto-title">
					<p class="p1">——————————————<span>精彩视频</span>——————————————</p>
					<p class="p2">Customer Photos</p>
					<p class="p3">把握人生每一刻 记录您希望被记录的每一瞬间</p>
				</div>
				<div class="hotvideo-box">
					<div style="width:1210px;overflow: hidden;" id="imgs">
						<!--<div class="video-p">
							<div class="vptop">
								<img src="img/P.png" />
								<p class="vbox">
									<span class="vkind">月子馆</span>
									<span class="uppercase vletter">confinement Museum</span>
								</p>
								<a class="more">更多</a>
							</div>
							<div class="bigv" id="bigv">
								<a>
									<img class="vimg" src="img/baby9.jpg" />
									<div class="bg"></div>
								</a>
							</div>
							<div class="smallv">
								<a class="svp" onclick="demo()"><img src="img/baobao3.jpg"/></a>
								<a class="svp"><img src="img/baoabao2.jpg"/></a>
								<a class="svp"><img src="img/c4.jpg"/></a>
								<a class="svp"><img src="img/c1.jpg"/></a>
							</div>
						</div>-->
					</div>
				</div>
				<!--<div class="hotvideo-box">
					<div style="width:1196px;overflow: hidden;">
						<ul id="mom_video">
						</ul>
					</div>
				</div>-->
			</div>
		</div>
		<div class="Mom-photo" id="month">
			<div class="Mbox">
				<div class="Mphoto-title">
					<p class="p1">——————————————<span>美妈照片</span>——————————————</p>
					<p class="p2">Customer Photos</p>
					<p class="p3">把握人生每一刻 记录您希望被记录的每一瞬间</p>
				</div>
				<div class="hotvideo-box">
					<span class="block1">美妈照</span>
					<span class="block2">US</span>
					<a class="more rmore" href="MomPhoto.html">更多</a>
					<span class="block3">BEAUTIFUL MOTHER PHOTOS</span>
					<div class="v_box">
						<!--<div class="pbox">
							<a class="block4 shademouse" href="home.html">
								<img src="img/baby10.jpg"/>
								<div class="bg">
									<p class="shadetxt">xxxx</p>
								</div>
							</a>
							<div style="float: left;width:550px;">
								<a class="block5 shademouse" href="home.html">
									<img src="img/baby10.jpg"/>
									<div class="bg">
										<p class="shadetxt">xxxx</p>
									</div>
								</a>
								<a class="block5 shademouse" href=""><img src="img/baby10.jpg"/></a>
								<a class="block5" href=""><img src="img/baby10.jpg"/></a>
								<a class="block5" href=""><img src="img/baby10.jpg"/></a>
							</div>
							<a class="block6" href=""><img src="img/baby10.jpg"/></a>
						</div>-->
					</div>
					<a style="float: left;" id="mother"></a>
				</div>
			</div>
		</div>
		<div class="Mom-photo" id="activity">
			<div class="Mbox">
				<div class="Mphoto-title">
					<p class="p1">——————————————<span>活动照片</span>——————————————</p>
					<p class="p2">Customer Photos</p>
					<p class="p3">把握人生每一刻 记录您希望被记录的每一瞬间</p>
				</div>
				<div class="hotvideo-box">
					<span class="block1">活动照</span>
					<span class="block2">US</span>
					<a class="more rmore" href="activityPhoto.html">更多</a>
					<span class="block3">THE ACTIVITIES OF THE PHOTOS</span>
					<div class="a_box">
						
					</div>
				</div>
			</div>
		</div>
	</div>
	<input type="hidden" value="tv" id="navid" />
	<script type="text/javascript" src="js/footer.js"></script>
	<script type="text/javascript" src="js/banner.js"></script>

	<script>
	$(function() {
		demo();
		submitb();
		submitbtn();
	});
	
	function demo() {
		var key ;//= $("#key").val();
		$.ajax({
			url: '/baby/liveVideoShow/getAllLiveVideoShow', // 跳转到 action  
			data: {
//				pageNum: 1,
//				key: key
			},
			type: 'post',
			cache: false,
			dataType: 'json',
			success: function(data) {
				console.log("sss")
				console.log(data)
				if(data.code == "2000") {
					var data = data.data;
					var month='';
					var baby='';
					var usa='';
					var name='';
					var month_img='';
					var month_imgs='';
					var baby_img='';
					var baby_imgs='';
					var usa_img='';
					var usa_imgs='';
					var month_sid = '';
					var baby_sid = '';
					var usa_sid = '';
					for(var i =0;i<data.length;i++){
						if(data[i].videoType=='1'){
							//月子馆
							if(month_img.length <5){
							month_sid+='	<a class="more" href="videoDetail.html?sid='+data[i].sid+'&type='+data[i].videoType+'">更多</a>'
								month_img='<a class="shademouse" href="videoDetail.html?sid='+data[i].sid+'&type='+data[i].videoType+'"><img class="vimg" src="'+data[i].img.realPicUrl+'" />'
											+'<div class="bg"><p class="shadetxt">'+data[i].name+'</p></div></a>'
							}else{
								month_imgs+='<a class="svp shademouse" href="videoDetail.html?sid='+data[i].sid+'&type='+data[i].videoType+'"><img src="'+data[i].img.realPicUrl+'"/>'
											+'<div class="bg"><p class="shadetxt shadesmalltxt">'+data[i].name+'</p></div></a>'
							}
						}
						if(data[i].videoType=='2'){
							//在美国
							if(baby_img.length <5){
								baby_sid='<a class="more" href="videoDetail.html?sid='+data[i].sid+'&type='+data[i].videoType+'">更多</a>';
								baby_img='<a class="shademouse" href="videoDetail.html?sid='+data[i].sid+'&type='+data[i].videoType+'"><img class="vimg" src="'+data[i].img.realPicUrl+'" />'
											+'<div class="bg"><p class="shadetxt">'+data[i].name+'</p></div></a>'
							}else{
								baby_imgs+='<a class="svp shademouse" href="videoDetail.html?sid='+data[i].sid+'&type='+data[i].videoType+'"><img src="'+data[i].img.realPicUrl+'"/>'
											+'<div class="bg"><p class="shadetxt shadesmalltxt">'+data[i].name+'</p></div></a>'
							}
						}
						if(data[i].videoType=='3'){
							//赴美那些事
							if(usa_img.length <5){
								usa_sid='	<a class="more" href="videoDetail.html?sid='+data[i].sid+'&type='+data[i].videoType+'">更多</a>';
								usa_img='<a class="shademouse" href="videoDetail.html?sid='+data[i].sid+'&type='+data[i].videoType+'"><img class="vimg" src="'+data[i].img.realPicUrl+'" />'
											+'<div class="bg"><p class="shadetxt">'+data[i].name+'</p></div></a>'
							}else{
								usa_imgs+='<a class="svp shademouse" href="videoDetail.html?sid='+data[i].sid+'&type='+data[i].videoType+'"><img src="'+data[i].img.realPicUrl+'"/>'
											+'<div class="bg"><p class="shadetxt shadesmalltxt">'+data[i].name+'</p></div></a>'
							}
						}
					}
					month+='<div class="video-p">'
							+'<div class="vptop"><img src="img/P.png" />'
							+'	<p class="vbox">'
							+'		<span class="vkind">月子馆</span>'
							+'		<span class="uppercase vletter">confinement Museum</span>'
							+'	</p>'
							+month_sid
							+'</div>'
							+'<div class="bigv" id="bigv">'
							+month_img
							+'</div>'
							+'<div class="smallv">'
							+month_imgs
							+'</div>'
							+'</div>';
					baby+='<div class="video-p">'
							+'<div class="vptop"><img src="img/v.png" />'
							+'	<p class="vbox">'
							+'		<span class="vkind">美妈在美国</span>'
							+'		<span class="uppercase vletter">in&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;the&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;usa</span>'
							+'	</p>'
							+baby_sid
							+'</div>'
							+'<div class="bigv" id="bigv">'
							+baby_img
							+'</div>'
							+'<div class="smallv">'
							+baby_imgs
							+'</div>'
							+'</div>';
					usa+='<div class="video-p">'
							+'<div class="vptop"><img src="img/t.png" />'
							+'	<p class="vbox">'
							+'			<span class="vkind">赴美生子那些事</span>'
							+'	<span class="uppercase vletter">COMEDY  MAN JACK</span>'
							+'	</p>'
							+usa_sid
							+'</div>'
							+'<div class="bigv" id="bigv">'
							+usa_img
							+'</div>'
							+'<div class="smallv">'
							+usa_imgs
							+'</div>'
							+'</div>';
					
					$("#imgs").html('');
					$("#imgs").append(month);
					$("#imgs").append(baby);
					$("#imgs").append(usa);
					shade();
					
					//拼页面
					//第一行
//					var htmlstr = '';
//					var htmlimg = '';
//					var length = datalist.length;
//					var length2 = datalist.length;
//					


				} else if(data.code == "5001") {
					alert(data.message);
					window.parent.location.href = 'http://localhost:8080/baby/resource/admin/login.html'
					console.log(data);

				}
			},
			error: function() {
				// view("异常！");  
				//alert("异常！");
			}
		});
	};
//美妈照片
function submitb(){
	$.ajax({
		url:'/baby/usaBabyMonth/queryMenuUsaBabyMonth',
		data:{
			menutype : '9e39cbc16874495695864c1e4dd0feb5'
		},
		type:'post',
		cache:false,
		dataType:'json',
		success:function(data){
			console.log(data);
			if(data.code == "2000"){ 
	         var data = data.data;
				var img = '';
				var num1 = '';
				var num2='';
				var num3='';
				var title='';
				for(var i = 0; i < data.length; i++ ){
					img = data[i].imgData[0];
					title = data[i].title;
					var obj = data[i];
					var comurl = "MomPhotoDetail.html?sid=" + obj.sid;
					if(i==0){
						num1='<a class="block4 shademouse" href="' + comurl + '"><img src="'+img.realPicUrl+'"/>'
								+'<div class="bg bgb"><p class="shadetxtb">'+title+'</p></div></a>'
					}
					if(i>0 && i<5){
						num2+='<a class="block5 shademouse" href="' + comurl + '"><img src="'+img.realPicUrl+'"/>'
								+'<div class="bg bgb"><p class="shadetxtb shadesmalltxtb">'+title+'</p></div></a>'
					}
					
					if(i==5){
						num3='<a class="block6 shademouse" href="' + comurl + '"><img src="'+img.realPicUrl+'"/>'
								+'<div class="bg bgb"><p class="shadetxtb">'+title+'</p></div></a>'
					}
									
				}
				str='<div class="pbox">'+num1+'<div style="float: left;width:550px;">'+num2+'</div>'
					+num3+'</div>';
				$(".v_box").html(str);
				shade();
	        }
		},error:function(data) {
			console.log("服务请求的人太多"+data);
		}
	})
}
//活动照片
function submitbtn(){
	$.ajax({
		url:'/baby/usaBabyMonth/queryMenuUsaBabyMonth',
		data:{
			menutype : 'a129d72574344578b7291cff1d72e542'
		}, 
		type:'post',
		cache:false,
		dataType:'json',
		success:function(data){
			console.log(data);
			if(data.code == "2000"){ 
	         var data = data.data;
				var img = '';
				var num1 = '';
				var num2='';
				var num3='';
				var title='';
				for(var i = 0; i < data.length; i++ ){
					img = data[i].imgData[0];
					title = data[i].title;
					var obj = data[i];
					var comurl = "activityPhotoDetail.html?sid=" + obj.sid;
					if(i==0){
						num1='<a class="block4 shademouse" href="' + comurl + '"><img src="'+img.realPicUrl+'"/>'
								+'<div class="bg bgb"><p class="shadetxtb">'+title+'</p></div></a>'
					}
					if(i>0 && i<5){
						num2+='<a class="block5 shademouse" href="' + comurl + '"><img src="'+img.realPicUrl+'"/>'
								+'<div class="bg bgb"><p class="shadetxtb shadesmalltxtb">'+title+'</p></div></a>'
					}
					
					if(i==5){
						num3='<a class="block6 shademouse" href="' + comurl + '"><img src="'+img.realPicUrl+'"/>'
								+'<div class="bg bgb"><p class="shadetxtb">'+title+'</p></div></a>'
					}
									
				}
				str='<div class="pbox">'+num1+'<div style="float: left;width:550px;">'+num2+'</div>'
					+num3+'</div>';
				$(".a_box").html(str);
				shade();
	        }
		},error:function(data) {
			console.log("服务请求的人太多"+data);
		}
	})
}
		/*视频遮盖*/
		function shade() {
//			$('.carousel').carousel({
//				interval: 4000
//			});
			$(".shademouse").mouseover(function(){
		    	$(this).children(".bg").show();
		  	});
		  	$(".shademouse").mouseout(function(){
		   	 	$(this).children(".bg").hide();
		  	});

		}

	</script>
</body>
</html>